home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / OTHER_LA / QUINTA / FRAC.Q < prev    next >
Text File  |  1990-03-22  |  479b  |  11 lines

  1. ; This routine was written by Jurjen N.E. Bos (jurjen@cwi.nl)
  2. ; for the HP-28 calculator.  Very little conversion was necessary
  3. ; for Quinta to handle it nicely.  Also, I modified his code
  4. ; to always operate at the highest precision possible.
  5.  
  6. [ 15.0 neg alog 2 / "p" local "x" local 1 "a" local 0 "b" local
  7. x while x a * 0.5 + floor x a * - abs p a * >= repeat
  8.      inv dup ip abs a * b + a 'b' sto 'a' sto fp end
  9.   drop x a * 0.5 + floor a >expr / ] "frac" pub float respond
  10.  
  11.